/**
 * 
 */
package com.bicon.base.data.common;

import java.util.Map;

import com.google.common.collect.Maps;

/**
 * @author zyl
 * @date 2016年5月25日
 * 
 */
public class Constants {

	public static final String NO_EXCEPTION_CODE = "0001";
	
	public static final String SELECT_TYPE = "SELECT";
	
	public static final String INSERT_TYPE = "INSERT";
	
	public static final String UPDATE_TYPE = "UPDATE";
	
	public static final String DELETE_TYPE = "DELETE";
	
	public static final String SESSION_USER = "session_user";
	
	public static final String SUCESS_STATE = "true";
	
	public static final String ERROR_FLAGE = "ERROR";
	
	public static final String ERROR_STATE = "false";
	
	public static final String ERROR_TIP = "系统未知错误";
	
	public static final String VISITOR = "guest";
	
	public static final String DATE_FORMATE = "yyyyMMddHHmmss";
	
	
	public static final String JNDI_PATH = "conf/jndi.properties";
	
	public static final String BANK_KEY = "CNBANK";
	
//    public static final String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver";
//    
//    public static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver";
//    
    
	
	
	public static final String XMP_PATH = "classpath:spring-other.xml";
	
	public static final String REDIS_PROPERTIES_PATH = "db.properties";
	
	public static final String AVRO_PATH = "conf/log.avpr";
	
	public static final String LOGIN_SIGN = "LOGIN_SIGN";
	public static final String LOGIN_SUCCESS = "LOGIN_SUCCESS";
	
	public static final String DELETE_SUCCESS = "success";
	public static final String DELETE_ERROR = "删除失败";
	
    public static final String GBK_ENCODE_FORMATE = "GBK";
	
	public static final String NUMBER_FORMATE = "ISO-8859-1";
	
	public static final String GB2312_STR = "GB2312";
	
	public static final String ZERO_STRING = "zero";
	
	public static final String SPACE_STRING = "space";
	
	
	public static final String SOCKET_IP = "socketIp";
	
	
	public static final String SOCKET_PORT = "socketPort";
	
	public static final String LOCAL_FILEPATH = "localfilepath";
	/*************************************************************报文部分********************************************/
	
 	public static final String STRING_00000001 = "00000001";
 	
 	public static final String STRING_001 = "001";
 	
 	public static final String  STRING_3123 = "3123";
 	
 	public static final String STRING_3011 = "3011";
 	
 	public static final String  STRING_0033 = "0033";
	
	public static final String STRING_000 = "000";
	
	public static final String  STRING_8000 = "8000";
	
	public static final String  PROD_STRING = "PROD";
	
	public static final String  ZERO_NUMBER =  "0" ;
	
	public static final String  STRING_01 = "01"; 
	
	public static final String CHAR_STRING = "\r\n";
	
	public static final String UC_STRING = "UC";
	
	public static final String STRING_0000000001A = "0000000001A";
	
	/** 固定标签头 */
	public final static String TAG_HEAD = "1000";
	
	/** 报文头长度 */
	public final static int MESSAGE_HEAD_LENGTH = 46;
	/** 报文尾长度 */
	public final static int MESSAGE_TAIL_LENGTH = 49;
	
	/*
	 * 16进制字符数组
	 */
	public static final char[] HEX_DIGITS = "0123456789ABCDEF".toCharArray();
	
	public static  enum  State{
		NONE("已完成",1), NORMAL("正常等待",2), PAUSED("暂停",3), COMPLETE("执行中",4), ERROR("错误",5), BLOCKED("阻塞中",6);
		public String name;  
		public int index;  
	    
	    private State(String name,int index){
	    	this.name = name;
	    	this.index = index;
	    }
	     // 普通方法  
	    
	    public static String getName(int index) {
	        for (State c : State.values()) {  
	            if (c.index  == index) {  
	                return c.name;  
	            }  
	        }  
	        return null;  
	    }
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public int getIndex() {
			return index;
		}
		public void setIndex(int index) {
			this.index = index;
		} 
	
	
    }
	
	public static final Map<String,String> CODE_MAP = Maps.newHashMap();
	
	static{
		CODE_MAP.put("00", "成功");
		CODE_MAP.put("02", "无效的消息类型码");
		CODE_MAP.put("03", "无效的消息版本");
		CODE_MAP.put("04", "无效的报文长度");
		CODE_MAP.put("05", "MAC错");
		CODE_MAP.put("06", "文件摘要验证失败");
		CODE_MAP.put("07", "文件名不合法");
		CODE_MAP.put("08", "文件大小或内容不合法");
		CODE_MAP.put("09", "无效文件断点");
		CODE_MAP.put("50", "系统错误");
		
	}
	//绿城通发卡机构代码
	public final static String CHANG_AN_TONG_ISSR_CODE = "01974910";
	//绿城通单机构代码
	public final static String CHANG_AN_TONG_ACQ_CODE = "11974910";
	//2062 普通充资交易,2066 普通充资交易(旧卡转值),2064 月票充资交易
	public final static String NORMAL_RECHARGE_TRADE_CODE = "2062";
	//public final static String NORMAL_RECHARGE_TRADE_CODEOLD = "2066";
	public final static String MONTH_RECHARGE_TRADE_CODE = "2064";
	//2062 充资交易 ,2063 售卡交易,2065 售卡交易(旧卡更换),3468 补售交易,7055挂失,
	//3454 退资申请,7502 年审,3466 押金调整,3464 退丢失卡押金,3462 补退卡差额
	public final static String RECHARGE_TRADE_CODE = "2062";
	public final static String SELLING_CARD_CODE = "2063";
	public final static String SELLINGOLD_CARD_CODE = "2065";
	public final static String  FILL_SALE_CODE = "3468";
	public final static String  REPORT_LOSS_CODE = "7055";
	public final static String  RETURN_APPLICATION_CODE = "3454";
	public final static String  ANNUA_LVERIFICATION_CODE = "7502";
	public final static String  DEPOSIT_ADJUSTMENT_CODE = "3466";
	public final static String  REFUND_LOSTCARD_DEPOSIT_CODE = "3464";
	public final static String  CREDIT_CARD_BALANCE_CODE = "3462";
	
	
	//3452 退卡完成 ，3456 退资完成 ，3460 换卡完成 ,3457月票钱包退款（退资完成）
	public final static String RETURN_CARD_FINISH = "3452";
	public final static String REFUNAL_MONEY_FINISH = "3456";
	public final static String YP_REFUNAL_MONEY_FINISH = "3457";
    public final static String  CHANGE_CARD_FINISH = "3460";
 
    //0000 补卡完成
    public final static String  REPLACEMENT_CARD_FINISH = "0000";
    //8451 普通消费,8453 普通公交消费,8460 复合交易开始 ,8461 复合交易结束 ,8462 延时复合交易开始 ,8463 延时复合交易结束 ,8465 补票 ,8470锁卡，8471解锁,8456 月票钱包一般消费,8458 月票钱包公交消费,8467 月票钱包上车消费,8468 月票钱包下车消费
	public final static String CONSUME_CARD_TRADE_CODE = "8451,8453,8461,8463,8465,8470,8456,8468,8458";
	//1335 钱包圈存
	public final static String TRANSFERENCE_CARD_TRADE_CODE = "1335";
	
	public final static String MONTH_CONSUME_CARD_TRADE_CODE ="8456,8358,8468";
	
	//补卡售卡 3468
	public final static String BUSELL_CARD_CODE = "3468";
	// 调整押金3466
	public final static String ADJUST_DESTION_CODE = "3466";
	
	//普通消费 8451 月票消费 8456 月票钱包公交消费8458
	public final static String NORMAL_CONSUM_TRADE_CODE = "8451";
	public final static String MONTH_CONSUM_TRADE_CODE = "8456";
	public final static String MONTH_CONSUM_BUS_TRADE_CODE ="8458";
	
    //挂失7055、解挂7065、年审7502、押金调整3466、退丢失卡押金3464、补退卡差额3462在申请交易完成表；
	public final static String REPORT_LOSS_TRADE_CODE = "7055";
	public final static String SOLUTION_HANG_CODE = "7065";
	public final static String YEAR_CAREFUL_CODE = "7502";
	public final static String LOSS_CARD_DEPOSIT = "3464";
	public final static String BALANCE_REFUNDED_CARD = "3462";
	//换卡申请3458、退资申请 3454在申请交易登记表
	public final static String CHANGE_CARD_APPLY_CODE = "3458";
	public final static String REFUNDED_APPLY_CODE = "3454";
	public final static String LOCK_CARD = "8470";//锁卡
	public final static String  RECHARGE_MONTH_TRADE_CODE= "2064";
	
}
